package com.medusa.aps.business.modules.demand.mp.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.medusa.aps.business.model.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 排产全局设置实体类
 *
 * @author yuxh
 * @since 2023-08-14 17:37:46
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class GlobalSettingsForScheduling extends BaseEntity<GlobalSettingsForScheduling> {
    /**
     * 主键
     */
    @Schema(description = "主键")
    private Integer id;
    /**
     * 排程开始时间
     */
    @Alias("排程开始时间")
    @Schema(description = "排程开始时间")
    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private LocalDate schedulingStartTime;
    /**
     * 排程结束时间
     */
    @Alias("排程结束时间")
    @Schema(description = "排程结束时间")
    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private LocalDate schedulingEndTime;
    /**
     * 排程最新开始时间
     */
    @Schema(description = "排程最新开始时间", hidden = true)
    private LocalDateTime schedulingLatestStartTime;

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    public Serializable pkVal() {
        return this.id;
    }
}

